Skip to content

feat(tron-wallet-snap): remove assets migration feature-flag routing - #97

Draft
ulissesferreira wants to merge 14 commits into
ulissesferreira/wpn-1497-core-adapter-routing-9863from
WPN-1497-remove-assets-migration-flag
Draft

feat(tron-wallet-snap): remove assets migration feature-flag routing#97
ulissesferreira wants to merge 14 commits into
ulissesferreira/wpn-1497-core-adapter-routing-9863from
WPN-1497-remove-assets-migration-flag

Conversation

@ulissesferreira

Copy link
Copy Markdown
Contributor

Summary

  • Remove SnapsAssetsMigrationStage / remote feature-flag resolution from AssetsService and SnapAssetsAdapter
  • Always route fungible reads (getAccountAssetByID, getAccountAssetsByIDs, getAccountAssetsByScope) through Core AssetsController via AssetsProvider
  • Keep snap-owned protocol assets (energy, bandwidth, staking, lock/withdrawal, rewards) on the Snap adapter for sync, reads, and keyring events
  • Drop RemoteFeatureFlagController:getState messenger endowment and @metamask/remote-feature-flag-controller devDependency

PR chain

#90#91#92#95#96this PR

Test plan

  • yarn workspace @metamask/tron-wallet-snap run jest --no-coverage src/services/assets/AssetsService.test.ts
  • CI green (manifest shasum may need Linux CI value)

@ulissesferreira
ulissesferreira requested review from a team as code owners August 2, 2026 23:53
@ulissesferreira
ulissesferreira marked this pull request as draft August 3, 2026 09:19
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-core-adapter-routing branch from 1a63feb to 3dc547d Compare August 4, 2026 13:45
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-remove-assets-migration-flag branch 2 times, most recently from 313552f to 03454c3 Compare August 4, 2026 13:54
@ulissesferreira
ulissesferreira force-pushed the WPN-1497-core-adapter-routing branch from 3dc547d to d387059 Compare August 4, 2026 13:54
@cursor
cursor Bot force-pushed the WPN-1497-core-adapter-routing branch from d387059 to ea6cdf4 Compare August 5, 2026 10:16
jeremytsng pushed a commit that referenced this pull request Aug 5, 2026
## Explanation

This PR extends the Snap’s transaction handling by introducing a
`TransactionMapper` that classifies/massages Horizon on-chain
transactions into MetaMask keyring transaction shapes
(send/swap/change-trust/receive), while also standardizing keyring
“asset” payloads to include `unit`, `amount`, and `fungible` fields and
adding some supporting formatting utilities/constants.

**Changes:**
- Added `TransactionMapper` (+ tests + Horizon fixtures) to map Horizon
transactions into keyring transactions and to skip dust payments.
- Expanded transaction utilities with operation/transaction-type
detectors (swap/receive/change-trust/dust/status helpers).
- Standardized keyring transaction request `asset` shapes and added a
shared `removeTrailingZeros` helper (plus tests) and a dust-amount
constant.

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
Upload packages/*/dist from the monorepo Build job and restore them into
packages/ in each Test matrix cell so snaps-jest finds dist/bundle.js
without a per-package rebuild. Pin upload/download-artifact to commit SHAs.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the WPN-1497-core-adapter-routing branch from ea6cdf4 to 619915e Compare August 5, 2026 18:11
@cursor
cursor Bot force-pushed the WPN-1497-remove-assets-migration-flag branch from 03454c3 to 087ea4d Compare August 5, 2026 18:21
@cursor
cursor Bot force-pushed the WPN-1497-core-adapter-routing branch from 619915e to bfa488d Compare August 5, 2026 18:22
@cursor
cursor Bot changed the base branch from WPN-1497-core-adapter-routing to ulissesferreira/wpn-1497-core-adapter-routing-9863 August 5, 2026 18:24
@cursor
cursor Bot force-pushed the WPN-1497-remove-assets-migration-flag branch from 087ea4d to d243286 Compare August 5, 2026 18:24
@cursor
cursor Bot force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch from bfa488d to 327dfab Compare August 5, 2026 18:29
@cursor
cursor Bot force-pushed the WPN-1497-remove-assets-migration-flag branch 4 times, most recently from b5592e2 to 0d032f7 Compare August 5, 2026 18:54
cursoragent and others added 4 commits August 5, 2026 19:08
Add --topological-dev to the root yarn build script so workspace
libraries (e.g. @metamask/snap-networks-utils) finish building before
packages that depend on them. Keeps --parallel for independent packages.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Instantiate Core messenger via getMessenger and wire
RemoteFeatureFlagsProvider / AssetsProvider into context for the
upcoming AssetsController migration. Reads still delegate to
SnapAssetsAdapter.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch from 61a0b87 to 6769ec9 Compare August 5, 2026 19:34
cursoragent and others added 4 commits August 5, 2026 19:34
…oller

Introduce migration-stage routing for fungible asset reads (Off /
ReadWithFallback / Read) via AssetsProvider, with mapControllerAsset and
SnapAssetsAdapter updates. Snap-owned assets remain on the Snap adapter.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
…link

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
cursoragent and others added 2 commits August 5, 2026 19:34
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch from 6769ec9 to 4d766ab Compare August 5, 2026 19:34
@cursor
cursor Bot force-pushed the WPN-1497-remove-assets-migration-flag branch from 0d032f7 to 6fe7f9f Compare August 5, 2026 19:34
cursoragent and others added 3 commits August 5, 2026 19:34
Always route fungible asset reads through Core AssetsController via
AssetsProvider. Keep snap-owned protocol assets on SnapAssetsAdapter for
sync, reads, and keyring events. Drop RemoteFeatureFlagController:getState
messenger endowment and the remote-feature-flag-controller dependency.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
…etsAdapter

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the WPN-1497-remove-assets-migration-flag branch from 6fe7f9f to 64f08a9 Compare August 5, 2026 19:35
@cursor
cursor Bot force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch from 4d766ab to af82730 Compare August 6, 2026 09:29
@ulissesferreira
ulissesferreira force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch 11 times, most recently from 9c70ee3 to a793675 Compare August 6, 2026 15:06
@cursor
cursor Bot force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch from a793675 to 99fa147 Compare August 6, 2026 16:34
@ulissesferreira
ulissesferreira force-pushed the ulissesferreira/wpn-1497-core-adapter-routing-9863 branch from 99fa147 to 00333d9 Compare August 7, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants